<?php
/*
Copy this file into your current active theme's directory to customize this template

This template displays the comments for a photo
*/

?>
<h4 id="comments"><span class="num"><?php echo count($comments);?></span> comments</h4>

<?php if (is_array($comments) && count($comments)): foreach($comments as $comment):?>
<div class="comment">
<p>
<?php if ($comment['author']['iconserver'] > 0):?>
    <img class="buddy" width="48" height="48" src="http://static.flickr.com/<?php echo $comment['author']['iconserver']?>/buddyicons/<?php echo $comment['author']['nsid']?>.jpg" align="left" />
<?php else: ?>
    <img class="buddy" width="48" height="48" src="http://www.flickr.com/images/buddyicon.jpg" align="left" />
<?php endif; ?>
<em><a href="<?php echo $comment['author']['photosurl']?>"><?php echo ($comment['author']['realname'] ? $comment['author']['realname'] : $comment['author']['username'] )?></a> wrote...</em><br>
<?php echo $comment['comment']?></p>
</div>
<?php endforeach;?>
<br style="clear:both;" />
<p><a href="http://www.flickr.com/photos/<?php echo $photo['owner']['nsid'];?>/<?php echo $photo['id'];?>/#reply">Add a comment &gt;</a></p>
<?php else:?>
<p>No comments for this photo. 
<a href="http://www.flickr.com/photos/<?php echo $photo['owner']['nsid'];?>/<?php echo $photo['id'];?>/#reply">Add a comment &gt;</a></p>
<?php endif;?>